﻿<UserControl
    x:Class="FU.Capstones.IMS.Web.Silverlight.Controls.MaterialSearchControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Groupbox="clr-namespace:Groupbox;assembly=Groupbox"
    xmlns:CustomControls="clr-namespace:FU.Capstones.IMS.Web.Common.CustomControls;assembly=FU.Capstones.IMS.Web.Common"
    xmlns:Controls="clr-namespace:FU.Capstones.IMS.Web.Silverlight.Controls">
    <Groupbox:GroupBox Background="Transparent">
        <Groupbox:GroupBox.Header>
            <TextBlock 
                Text="Tìm kiếm"
                Style="{StaticResource TextBlockGroupBoxTitleStyle}"
                        />
        </Groupbox:GroupBox.Header>
        <Grid x:Name="LayoutRoot" Background="Transparent" ShowGridLines="False">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <!--Tên vật liệu-->
            <TextBlock
				Grid.Row="0" Grid.Column="0"
                Style="{StaticResource TextBlockNormalStyle}"
				Text="{StaticResource MaterialNameLabelText}"
			/>
            <TextBox
			    Grid.Row="0" Grid.Column="1"
                Style="{StaticResource TextBoxNormalStyle}"
                Watermark="{Binding ElementName=lblMaterialName, Path=Text}"
			    Text="{Binding Path=MaterialCriteria.MaterialNameSearch, Mode=TwoWay}"
		    />

            <!--Mã vật liệu-->
            <TextBlock 
			    Grid.Row="1" Grid.Column="0"
                Style="{StaticResource TextBlockNormalStyle}"
			    Text="{StaticResource MaterialCodeLabelText}"
		    />
            <TextBox
			    Grid.Row="1" Grid.Column="1"
                Style="{StaticResource TextBoxNormalStyle}"
                Watermark="{Binding ElementName=lblMaterialCode, Path=Text}"
			    Text="{Binding Path=MaterialCriteria.MaterialCodeSearch, Mode=TwoWay}"
		    />

            <!--Kho chứa-->
            <TextBlock 
			    Grid.Row="0" Grid.Column="2"
                Style="{StaticResource TextBlockNormalStyle}"
			    Text="{StaticResource WarehouseLabelText}"
		    />
            <ComboBox
			    Grid.Row="0" Grid.Column="3"
                Style="{StaticResource ComboBoxNormalStyle}"
                ItemsSource="{Binding Path=WarehouseCollection, Mode=TwoWay}"
                DisplayMemberPath="WarehouseName"
				SelectedItem="{Binding Path=MaterialCriteria.SelectedWarehouse, Mode=TwoWay}"
		    />

            <TextBlock
			    Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                Style="{StaticResource TextBlockNormalStyle}"
			    Text="{StaticResource TotalQuantityLabelText}"
            />
            
            <TextBlock 
			    Grid.Row="5" Grid.Column="0"
                Style="{StaticResource TextBlockRightStyle}"
			    Text="{StaticResource FromLabelText}"
            />
            <CustomControls:NumericTextBox
			    Grid.Row="5" Grid.Column="1"
                Style="{StaticResource TextBoxNumericStyle}"                
			    Text="{Binding Path=MaterialCriteria.TotalQuantityFrom, Mode=TwoWay}"
		    />
            
            <TextBlock 
			    Grid.Row="5" Grid.Column="2"
                Style="{StaticResource TextBlockRightStyle}"
			    Text="{StaticResource ToLabelText}"
            />
            <CustomControls:NumericTextBox
			    Grid.Row="5" Grid.Column="3"
                Style="{StaticResource TextBoxNumericStyle}"
			    Text="{Binding Path=MaterialCriteria.TotalQuantityTo, Mode=TwoWay}"
		    />

            <!--btnSearch-->
            <Controls:SearchButtonControl 
			    Grid.Column="5" Grid.Row="6"/>
        </Grid>
    </Groupbox:GroupBox>
</UserControl>
